Read Me About HIFleetingControls
================================
1.0

This sample demonstrates how to implement fleeting controls such as seen in QuickTime Player in full screen mode or in iPhoto in slide show mode when you move the mouse.

The code was built and tested on Mac OS X 10.4.9 (PowerPC and Intel).  The code code should work back to Mac OS X 10.2.

Packing List
------------
The sample contains the following items:

o Read Me About HIFleetingControls -- This document.
o HIFleetingControls.xcodeproj -- An Xcode 2.3 project for the sample
o build -- Contains a pre-built binary.
o HIVeryBasicView.h -- A Simple colorful shaped button.
o HIVeryBasicView.cp -- A Simple colorful shaped button.
o HIFleetingControlsView.h -- The custom fleeting controls view.
o HIFleetingControlsView.cp -- The custom fleeting controls view.
o main.c -- Standard Carbon application boilerplate code.
o main.nib -- Resources for the application.
o Info.plist -- An Info.plist file for the application.

Using the Sample
----------------
To use the sample, just launch it from the Finder.  Then move the mouse cursor over the text area to see the fleeting controls appear.  Stop moving the mouse for 3 seconds and see the fleeting controls slowly fade into nothingness.

Building the Sample
-------------------
The sample was built using Xcode 2.3 on Mac OS X 10.4.9.  You should be able to just open the project and choose Build from the Build menu.  This will build the HIFleetingControls application in the "build" directory.

How it Works
------------
First, a hot zone is associated with the fleeting controls view. This zone is where the mouse cursor has to be in for the fleeting controls to appear. This is done with the function HIFleetingControlsViewSetHotZone.

Second, when the mouse cursor enters the hot zone (kEventControlTrackingAreaEntered), an idle timer is installed to detect the user's inactivity.

Third, when the idle timer fires, checks are done to determine if the mouse cursor is on top of the fleeting controls themselves, and if those controls are already fading or not, see the function ShouldFadeTimer. If it is determined that the controls should fade then another timer is installed to make the fleeting controls fade into nothingness.

This fading is achieved by decrementing an alpha counter belonging to the fleeting controls view.  All embedded views (the actual controls, in the sample code a HIVeryBasicView) have to obtain this alpha value before drawing through the function HIFleetingControlViewGetAlphaIfEmbedded and use this value as a multiplicator for all their colored parts.

Credits and Version History
---------------------------
If you find any problems with this sample, mail <dts@apple.com> and I'll try to fix them up.

1.0 (Apr 2007) was the first shipping version.

Share and Enjoy.

Apple Developer Technical Support
